<script setup lang="ts">
// 建议添加props定义loading文案
defineProps<{
  message?: string
}>()
</script>

<template>
  <view class="loading-container">
    <view class="content">
      <!-- 使用props传入的message -->
      <text class="loading-text">{{ message || '当前页面正在开发中...' }}</text>
      <view class="spinner"></view>
    </view>
  </view>
</template>

<style lang="scss">
.loading-container {
  background-color: #28bb9c;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;

  .content {
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20rpx;
  }

  .loading-text {
    font-size: 32rpx;
    font-weight: normal;
  }

  .spinner {
    border: 12rpx solid #fff;
    border-top: 12rpx solid #28bb9c;
    border-radius: 50%;
    width: 80rpx;
    height: 80rpx;
    animation: spin 1.5s linear infinite;
  }

  @keyframes spin {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }
}
</style>
